package cn.tedu.pojo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class User {
	//对象关联关系
	@Autowired	//标识注解后，spring会容器中找dept对象，如果有，反射调用set方法
	//有私有属性是否能操作开关true，set方法（反射提供api）
	private Dept dept;//user当前对象所在部门
	
	public Dept getDept() {
		return dept;
	}

	public void setDept(Dept dept) {
		this.dept = dept;
	}

	private String userName = "小明";

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Override
	public String toString() {
		return "User [dept=" + dept + ", userName=" + userName + "]";
	}
	
}
